perf(secrets): parallelize provider fan-out and header resolution#276
Merged
RhysSullivan merged 1 commit intomainfrom Apr 17, 2026
Merged
perf(secrets): parallelize provider fan-out and header resolution#276RhysSullivan merged 1 commit intomainfrom
RhysSullivan merged 1 commit intomainfrom
Conversation
Several per-request hot paths iterated secret providers with sequential
yield*, turning a fan-out into N round-trips. Fix by switching to
Effect.all(..., { concurrency: 'unbounded' }).
- executor.ts secretsGet fallback: when the core routing-table misses,
ask every enumerating provider in parallel; first non-null in
registration order wins. Providers that throw are still treated as
'don't have it'.
- executor.ts secretsRemove: delete across every writable provider in
parallel. Providers don't coordinate on ownership — each gets asked,
and most calls are no-ops.
- executor.ts secretsList: provider.list() runs in parallel, then the
results are merged in registration order so 'first provider wins'
precedence remains deterministic.
- openapi/invoke.ts + graphql/invoke.ts resolveHeaders: resolve
secret-backed headers in parallel. OpenAPI fails the invocation on
any missing secret (unchanged semantics); GraphQL drops the header
silently on failure (unchanged semantics).
N is small (3-5 providers, 1-5 headers) so parallelism is unbounded;
no Effect.all concurrency cap needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several per-request hot paths iterated secret providers with sequential
yield*, turning a fan-out into N round-trips. Fix by switching to
Effect.all(..., { concurrency: 'unbounded' }).
executor.ts secretsGet fallback: when the core routing-table misses,
ask every enumerating provider in parallel; first non-null in
registration order wins. Providers that throw are still treated as
'don't have it'.
executor.ts secretsRemove: delete across every writable provider in
parallel. Providers don't coordinate on ownership — each gets asked,
and most calls are no-ops.
executor.ts secretsList: provider.list() runs in parallel, then the
results are merged in registration order so 'first provider wins'
precedence remains deterministic.
openapi/invoke.ts + graphql/invoke.ts resolveHeaders: resolve
secret-backed headers in parallel. OpenAPI fails the invocation on
any missing secret (unchanged semantics); GraphQL drops the header
silently on failure (unchanged semantics).
N is small (3-5 providers, 1-5 headers) so parallelism is unbounded;
no Effect.all concurrency cap needed.